home *** CD-ROM | disk | FTP | other *** search
/ Nebula 2 / Nebula Two.iso / SourceCode / MiscKit1.7.1 / MiscKit / Makefile < prev    next >
Makefile  |  1996-02-12  |  15KB  |  334 lines

  1. # Top-level MiscKit Makefile Version 1.7.1
  2. # Originally By Mike Ferris as Part of MOKit
  3. # Modified by Don Yacktman for use by the MiscKit, by permission
  4. # Copyright (C) 1994, by Don Yacktman, all rights reserved.
  5.  
  6. #########################################################################
  7. # Here are the things that you can safely configure...                  #
  8. #  1.  Where the MiscKit is installed                                   #
  9. #  2.  Whether or not the audio alerts are played                       #
  10. #  3.  Whether or not the README is forced upon you                     #
  11. #  4.  Which target architectures which are compiled                    #
  12. #  5.  Special flags used when building precompiled headers             #
  13. #  6.  Where to find a "tar" command that can handle long filenames     #
  14. #########################################################################
  15.  
  16. # Change root to somewhere in your account if you can't install to
  17. # /LocalDeveloper...  Warning:  do not use a ~ in ROOT; it must be absolute!
  18. ROOT = 
  19.  
  20. # Go ahead and change these to suit your taste--and patience.
  21. AUDIOALERTS = YES # Anything but "YES" will shut them up.
  22. SHOWREADME = YES # Anything but "YES" will supress automatic opening...
  23.  
  24. # Below, uncomment the architectures that you want.  Make sure your compiler
  25. # actually supports the selected architectures for it to work!
  26. # Comment out any that aren't useful to you or your compiler won't support.
  27. MOTOROLA_ARCH = m68k # Motorola (680x0) architecture
  28. INTEL_ARCH = i386 # Intel x86 architecture
  29. HP_ARCH = hppa # PA-RISC architecture
  30. SPARC_ARCH = sparc # SPARC architecture
  31. POWER_ARCH = #m98k # Power PC architecture.  Yeah, this is wishful thinking!
  32. ALPHA_ARCH = #alpha # DEC Alpha architecture.  Yeah, this is wishful thinking!
  33. OTHER_ARCH = # Add other architectures here.  We can hope...
  34.  
  35. # Configure this to define anything special you might need when building
  36. # the MiscKit precompiled headers.  For example, remove the pound sign
  37. # below if you plan to use the MiscKit under NEXTSTEP-J.
  38. PRECOMP_FLAGS = # -DKANJI
  39.  
  40. # GNU tar is preferred since some paths we will try to tar up for
  41. # installation are longer than tar's 100 character limit.  Regular
  42. # tar will NOT work for the install because of this!
  43. TAR = /usr/bin/gnutar # for NS 3.2 or greater
  44. #TAR = /usr/local/bin/gnutar
  45. # This tar handles long filenames if you haven't got gnutar
  46. #TAR = /NextAdmin/Installer.app/installer_bigtar
  47.  
  48. #########################################################################
  49. # Don't mess with anything beyond this line or you might mess something #
  50. # up beyond all hope of the gods and man.  Unless, of course, you       #
  51. # actually do know what you're doing...which may well be the case...    #
  52. #########################################################################
  53.  
  54. ARCHITECTURES = $(MOTOROLA_ARCH) $(INTEL_ARCH) $(HP_ARCH) \
  55.         $(SPARC_ARCH) $(POWER_ARCH) $(ALPHA_ARCH) $(OTHER_ARCH)
  56. ARCH_TOOL = /usr/lib/arch_tool
  57. TOOL_MAKE = /NextDeveloper/Makefiles/app/tool.make
  58. ARCHIFY = $(ARCH_TOOL) -archify_list
  59. ARCH_FLAGS = `$(ARCHIFY) $(ARCHITECTURES)`
  60.  
  61. LN_S = ln -s
  62. MAKE_PROG = /bin/make
  63.  
  64. NAME = MiscKit
  65. INSTALLROOT = $(ROOT)/LocalDeveloper
  66. DOC_INSTALL = $(INSTALLROOT)/Documentation/$(NAME)
  67. LIB_INSTALL = $(INSTALLROOT)/Libraries
  68. HEADER_INSTALL = $(INSTALLROOT)/Headers
  69. PALETTE_INSTALL = $(INSTALLROOT)/Palettes
  70. MAKEFILE_INSTALL = $(INSTALLROOT)/Makefiles
  71. EXAMPLE_SRC_INSTALL = $(INSTALLROOT)/Examples/$(NAME)
  72.  
  73. # These next six targets are all that should need to be modified in
  74. # order to add new MiscKit resources, as long as the resource has the
  75. # proper Misc* prefix naming convention.
  76. BUNDLES = MiscFindPanel MiscString MiscStringArray MiscDictionary
  77. LIBRARIES = MiscKit MiscInspectorKit MiscMergeKit MiscString MiscGISKit
  78. PALETTES_WITH_LIBS = MiscClockPalette MiscProgressPalette MiscDragViews \
  79.             MiscThreeStateButton MiscArrowButtonPalette MiscColorWells \
  80.             MiscValueFieldPalette MiscCircularSlider MiscLogSliderPalette\
  81.             MiscCalendarPalette MiscSoundPalette MiscTeePalette \
  82.             MiscDatePalette MiscClassDecoderPalette MiscShell \
  83.             MiscTabMatrixPalette MiscSwapKitPalette MiscGaugePalette \
  84.             MiscPaperViewPalette MiscClipTextPalette MiscTableScroll
  85. PALETTES = $(PALETTES_WITH_LIBS) MiscCoolButtons MiscString IBMole
  86. # Examples that test the MiscKit but don't install to /LocalDeveloper/Examples
  87. TESTAPP_EXAMPLES = MiscLockFile MiscLogFile MiscPriorityQueue MiscString \
  88.             DragViewTest MiscStringRegex TestExplodingMenus TableParse \
  89.             MailTest MiscDistributor
  90. # Makefile extensions that install to /LocalDeveloper/Makefiles
  91. MAKEFILE_EXTENSIONS = submission.make language.make
  92. # Examples that test the MiscKit and do install to /LocalDeveloper/Examples
  93. EXAMPLEAPP_EXAMPLES = MiscStringService TreeView SearchBench TinyTerm \
  94.             receiptfilter MiscTree_Browser generate-makefile cnvwrap \
  95.             MiscClassDecoder qlipo UNIX-HatersTool UsersAndGroups \
  96.             FileBrowser FileSearchTest BPM MergeTest MiscGISMapCoord \
  97.             Robby ScrollDir image2m LazyScrollDir SplitView IconTester
  98. # Example stuff that installs to /LocalDeveloper/Examples but doesn't compile
  99. EXAMPLEOTHERS = Interfaces DocTemplates IBMole ProjectTemplates getset \
  100.             AutoDoc format_comment
  101.  
  102. include Makefiles/$(NAME).version # grabs the version number
  103.  
  104. help:
  105.     @echo ""
  106.     @echo "************  Welcome to the $(NAME)!  ************"
  107.     @echo ""
  108.     @echo "The following Makefile targets are available:"
  109.     @echo "    make install   -- build and install the $(NAME)"
  110.     @echo "    make lib       -- build the $(NAME) library"
  111.     @echo "    make bundles   -- build the $(NAME) bundle projects"
  112.     @echo "    make palettes  -- build the $(NAME) palette projects"
  113.     @echo "    make examples  -- build the $(NAME) example applications"
  114.     @echo "    make debug     -- build the $(NAME) debugging libraries"
  115.     @echo "    make profile   -- build the $(NAME) profiling libraries"
  116.     @echo "    make all       -- build all six of the above targets"
  117.     @echo "    make uninstall -- remove the $(NAME) installation"
  118.     @echo "    make distclean -- clean the $(NAME) to a pristine distribution"
  119.     @echo ""
  120.     @echo "See documentation for other targets such as:   help, prep,"
  121.     @echo "build_debug_core, build_core, install_core, _install"
  122.     @echo ""
  123.     @echo "Read README.rtf first to catch any last minute gotchas!  Before"
  124.     @echo "installing you should agree with the terms of the $(NAME)"
  125.     @echo "license as it appears in License.rtf."
  126.     @echo ""
  127.     @echo "The $(NAME) Version $(FULL_VERSION) (C) 1995 by Don Yacktman"
  128.     @echo ""
  129.     @echo "Current Makefile configuration is to compile the following"
  130.     @echo "architectures:  $(ARCHITECTURES)"
  131.  
  132. all: lib bundles palettes examples debug profile
  133.  
  134. prep:
  135.     @if (test -f .prepped) ; then echo "Prepped...OK" ; \
  136.             else echo "Prepping for make..." ; \
  137.             Makefiles/prepmake $(ARCH_TOOL) $(TOOL_MAKE) ; fi
  138.     @touch .prepped
  139.  
  140. lib: prep
  141.     @(if test $(SHOWREADME) = YES; then open README.rtf; fi)&
  142.     @(if test $(AUDIOALERTS) = YES; then sndplay Makefiles/MiscBuild.snd; fi)&
  143.     @echo "************ Libraries ************"
  144.     @for i in $(LIBRARIES) none ; do \
  145.         if [ $$i = none ] ; then continue; fi; \
  146.         echo "*** Making $$i library" ; \
  147.         (cd Source/$$i; $(MAKE_PROG) lib "TARGET_ARCHS=$(ARCHITECTURES)"; mv *.a ..) ; \
  148.     done ;
  149.     @echo "************ Check main Library ************"
  150.     @echo "*** If there is text between this message and the end of main"
  151.     @echo "*** library check message, then an object file could be"
  152.     @echo "*** missing from the library.  Check the README.rtf for details."
  153.     @-(cd Source; otool -O libMiscKit.a > .otool.out; \
  154.         diff .otool.correct .otool.out; )
  155.     @echo "************ End of main Library check ************"
  156.  
  157. debug: prep
  158.     @echo "************ Debug Library ************"
  159.     @for i in $(LIBRARIES) none ; do \
  160.         if [ $$i = none ] ; then continue; fi; \
  161.         echo "*** Making $$i library" ; \
  162.         (cd Source/$$i; $(MAKE_PROG) debuglib "TARGET_ARCHS=$(ARCHITECTURES)"; mv *.a ..) ; \
  163.     done ;
  164.  
  165. profile: prep
  166.     @echo "************ Profile Library ************"
  167.     @for i in $(LIBRARIES) none ; do \
  168.         if [ $$i = none ] ; then continue; fi; \
  169.         echo "*** Making $$i library" ; \
  170.         (cd Source/$$i; $(MAKE_PROG) profilelib "TARGET_ARCHS=$(ARCHITECTURES)"; mv *.a ..) ; \
  171.     done ;
  172.  
  173. bundles: prep
  174.     @echo "************ Bundles ************"
  175.     @for i in $(BUNDLES) none ; do \
  176.         if [ $$i = none ] ; then continue; fi; \
  177.         echo "*** Making $$i class bundle" ; \
  178.         (cd Bundles/$$i; $(MAKE_PROG) "TARGET_ARCHS=$(ARCHITECTURES)"; ) ; \
  179.     done ;
  180.  
  181. examples: lib bundles palettes
  182.     @echo "************ Examples ************"
  183.     @for i in $(TESTAPP_EXAMPLES) none ; do \
  184.         if [ $$i = none ] ; then continue; fi; \
  185.         echo "*** Making $$i test app" ; \
  186.         (cd Examples/$$i; $(MAKE_PROG) "TARGET_ARCHS=$(ARCHITECTURES)"; ) ; \
  187.     done ;
  188.     @for i in $(EXAMPLEAPP_EXAMPLES) none ; do \
  189.         if [ $$i = none ] ; then continue; fi; \
  190.         echo "*** Making $$i example app" ; \
  191.         (cd Examples/$$i; $(MAKE_PROG) "TARGET_ARCHS=$(ARCHITECTURES)"; ) ; \
  192.     done ;
  193.  
  194. palettes: bundles
  195.     @echo "************ Palettes ************"
  196.     @for i in $(PALETTES) none ; do \
  197.         if [ $$i = none ] ; then continue; fi; \
  198.         echo "*** Making $$i palette" ; \
  199.         (cd Palettes/$$i; $(MAKE_PROG) "TARGET_ARCHS=$(ARCHITECTURES)"; ) ; \
  200.     done ;
  201.  
  202. build_debug_core: prep
  203.     @(if test $(SHOWREADME) = YES; then open README.rtf; fi)&
  204.     @(if test $(AUDIOALERTS) = YES; then sndplay Makefiles/MiscBuild.snd; fi)&
  205.     @echo "************ DEBUG Library ************"
  206.     (cd Source/MiscKit; $(MAKE_PROG) debuglib "TARGET_ARCHS=$(ARCHITECTURES)"; \
  207.             mv *.a ..) ;
  208.  
  209. build_core: prep
  210.     @(if test $(SHOWREADME) = YES; then open README.rtf; fi)&
  211.     @(if test $(AUDIOALERTS) = YES; then sndplay Makefiles/MiscBuild.snd; fi)&
  212.     @echo "************ Library ************"
  213.     (cd Source/MiscKit; $(MAKE_PROG) lib "TARGET_ARCHS=$(ARCHITECTURES)"; \
  214.             mv *.a ..) ;
  215.     @echo "************ Check main Library ************"
  216.     @echo "*** If there is text between this message and the end of main"
  217.     @echo "*** library check message, then an object file could be"
  218.     @echo "*** missing from the library.  Check the README.rtf for details."
  219.     @-(cd Source; otool -O libMiscKit.a > .otool.out; \
  220.         diff .otool.correct .otool.out; )
  221.     @echo "************ End of main Library check ************"
  222.  
  223. install_core: build_core
  224.     @echo "*** Installing library to $(LIB_INSTALL)"
  225.     mkdirs $(LIB_INSTALL)
  226.     (cd Source; $(TAR) -cf - lib*.a | (cd $(LIB_INSTALL); $(TAR) -xf - ;))
  227.     @echo "*** Installing headers to $(HEADER_INSTALL)"
  228.     mkdirs $(HEADER_INSTALL)
  229.     (cd Headers; $(TAR) -cf - * | (cd $(HEADER_INSTALL); $(TAR) -xf - ;))
  230.     (cd $(HEADER_INSTALL)/misckit; cc -O -g -Wall -ObjC -I$(HEADER_INSTALL) \
  231.                 -precomp $(ARCH_FLAGS) $(PRECOMP_FLAGS) misckit.h -o misckit.p)
  232.  
  233. _install:
  234.     @echo "************ Installing $(NAME) ************"
  235.     @echo "*** Installing libraries to $(LIB_INSTALL)"
  236.     mkdirs $(LIB_INSTALL)
  237.     (cd Source; $(TAR) -cf - lib*.a | (cd $(LIB_INSTALL); $(TAR) -xf - ;))
  238.     for i in $(PALETTES_WITH_LIBS) none ; do \
  239.         if [ $$i = none ] ; then continue; fi; \
  240.         (cd Palettes/$$i; $(TAR) -cf - *.a | \
  241.                 (cd $(LIB_INSTALL); $(TAR) -xf - ;)) ; \
  242.     done ;
  243.     @echo "*** Installing headers to $(HEADER_INSTALL)"
  244.     mkdirs $(HEADER_INSTALL)
  245.     (cd Headers; $(TAR) -cf - * | (cd $(HEADER_INSTALL); $(TAR) -xf - ;))
  246.     for i in $(PALETTES_WITH_LIBS) none ; do \
  247.         if [ $$i = none ] ; then continue; fi; \
  248.          (cd Palettes/$$i; cp *.subproj/*.h $(HEADER_INSTALL)/misckit; ) \
  249.     done ;
  250. # build the precomp header
  251.     (cd $(HEADER_INSTALL)/misckit; cc -O -g -Wall -ObjC -I$(HEADER_INSTALL) \
  252.                 -precomp $(ARCH_FLAGS) $(PRECOMP_FLAGS) misckit.h -o misckit.p)
  253.     @echo "*** Installing documentation to $(DOC_INSTALL)"
  254.     rm -rf $(DOC_INSTALL)
  255.     mkdirs $(DOC_INSTALL)
  256.     (cd Documentation; $(TAR) -cf - * .??* | (cd $(DOC_INSTALL); $(TAR) -xf - ;))
  257.     @echo "*** Building index for documentation ***
  258.     ixbuild -cs $(DOC_INSTALL)
  259.     @echo "*** Installing palettes to $(PALETTE_INSTALL)"
  260.     mkdirs $(PALETTE_INSTALL)
  261. # this is inefficient speed-wise, but makes for smaller palettes than the
  262. # tar method because it strips them.  Installs only happen once, and the
  263. # saved space is significant, so we'll take the performance hit.
  264.     for i in $(PALETTES) none ; do \
  265.         if [ $$i = none ] ; then continue; fi; \
  266.          (cd Palettes/$$i; $(MAKE_PROG) install INSTALLDIR=$(PALETTE_INSTALL) \
  267.             "TARGET_ARCHS=$(ARCHITECTURES)"; ) \
  268.     done ;
  269.     @echo "*** Installing supplementary Makefiles to $(MAKEFILE_INSTALL)"
  270.     mkdirs $(MAKEFILE_INSTALL)
  271.     (cd Makefiles; $(TAR) -chf - $(MAKEFILE_EXTENSIONS) | \
  272.                 (cd $(MAKEFILE_INSTALL); $(TAR) -xf - ;))
  273.     @echo "*** Installing example source code to $(EXAMPLE_SRC_INSTALL)"
  274.     mkdirs $(EXAMPLE_SRC_INSTALL)
  275.     (cd Examples; $(TAR) -chf - $(EXAMPLEAPP_EXAMPLES) $(EXAMPLEOTHERS) .??* | \
  276.                 (cd $(EXAMPLE_SRC_INSTALL); $(TAR) -xf - ;))
  277.     @(if test $(AUDIOALERTS) = YES; then sndplay Makefiles/MiscFinish.snd; fi)&
  278.  
  279. install: lib palettes _install
  280.  
  281. uninstall:
  282.     @echo "************ Uninstalling $(NAME) ************"
  283.     rm -rf $(LIB_INSTALL)/libMisc*.a \
  284.                 $(HEADER_INSTALL)/misckit \
  285.                 $(HEADER_INSTALL)/daymisckit \
  286.                 $(HEADER_INSTALL)/ExtendedApp.h \
  287.                 $(PALETTE_INSTALL)/IBMole.palette \
  288.                 $(PALETTE_INSTALL)/Misc*.palette \
  289.                 $(DOC_INSTALL) $(EXAMPLE_SRC_INSTALL) \
  290.                 $(MAKEFILE_INSTALL)/submission.make \
  291.                 $(MAKEFILE_INSTALL)/language.make
  292.  
  293. distclean:
  294.     @echo "************ Cleaning for distribution ************"
  295.     @(cd Source; rm -f *.a .otool.out; )
  296.     @for i in $(LIBRARIES) none ; do \
  297.         if [ $$i = none ] ; then continue; fi; \
  298.         (cd Source/$$i; $(MAKE_PROG) clean; ) \
  299.     done ;
  300.     @(cd Headers/misckit; rm -rf *.p; )
  301.     @for i in $(BUNDLES) none ; do \
  302.         if [ $$i = none ] ; then continue; fi; \
  303.         (cd Bundles/$$i; $(MAKE_PROG) clean; ) \
  304.     done ;
  305.     @for i in $(PALETTES) none ; do \
  306.         if [ $$i = none ] ; then continue; fi; \
  307.         (cd Palettes/$$i; $(MAKE_PROG) clean; ) \
  308.     done ;
  309.     @for i in $(TESTAPP_EXAMPLES) none ; do \
  310.         if [ $$i = none ] ; then continue; fi; \
  311.         (cd Examples/$$i; $(MAKE_PROG) clean; ) \
  312.     done ;
  313.     @for i in $(EXAMPLEAPP_EXAMPLES) none ; do \
  314.         if [ $$i = none ] ; then continue; fi; \
  315.         (cd Examples/$$i; $(MAKE_PROG) clean; ) \
  316.     done ;
  317.     rm -rf  Source/*/.lastBuildTime
  318. # get rid of those pesky .dir3_0.wmd files, but keep the top level one.
  319.     @cp .dir3_0.wmd .dir3_0.wmd~
  320.     find ./ -name .dir3_0.wmd -print | xargs rm -f
  321.     @cp .dir3_0.wmd~ .dir3_0.wmd
  322.     @rm -f .dir3_0.wmd~ .prepped
  323.  
  324. cleanexamples:
  325.     @echo "************ Cleaning examples ************"
  326.     @for i in $(TESTAPP_EXAMPLES) none ; do \
  327.         if [ $$i = none ] ; then continue; fi; \
  328.         (cd Examples/$$i; $(MAKE_PROG) clean; ) \
  329.     done ;
  330.     @for i in $(EXAMPLEAPP_EXAMPLES) none ; do \
  331.         if [ $$i = none ] ; then continue; fi; \
  332.         (cd Examples/$$i; $(MAKE_PROG) clean; ) \
  333.     done ;
  334.